package com.iemp.service.impl.list;

import com.iemp.bean.impl.Carousel;
import com.iemp.bean.example.CarouselExample;
import com.iemp.dao.CarouselMapper;
import com.iemp.service.base.AbstractListService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class CarouselServiceImpl extends AbstractListService<Carousel> {

    private final CarouselMapper mapper;

    public CarouselServiceImpl(CarouselMapper carouselMapper) {
        this.mapper = carouselMapper;
    }

    @Override
    public List findAllByList() {
        return mapper.selectByExample(new CarouselExample());
    }

    @Override
    public Integer deleteById(Integer id) {
        return mapper.deleteByPrimaryKey(id);
    }

    @Override
    public Carousel selectById(Integer id) {
        return mapper.selectByPrimaryKey(id);
    }

    @Override
    public int insertSelective(Carousel entity) {
        return mapper.insertSelective(entity);
    }

    @Override
    public int updateByIdSelective(Carousel entity) {
        return mapper.updateByPrimaryKeySelective(entity);
    }
}
